#ifndef __LIBCBGL32MEMORY_H__
#define __LIBCBGL32MEMORY_H__

#ifdef __cplusplus
	#define CBGL32MEMORYAPI extern "C"
#else
	#define CBGL32MEMORYAPI
#endif

#include <stddef.h>

CBGL32MEMORYAPI void* cbgl_memory_allocate(size_t size, const char* file, int line);
CBGL32MEMORYAPI void cbgl_memory_free(void* p);

#ifdef _DEBUG

	#define cbgl_malloc(size) cbgl_memory_allocate(size, __FILE__, __LINE__)
	#define cbgl_free(p) cbgl_memory_free(p)

#else
	#include <stdlib.h>
	#define cbgl_malloc(size) malloc(size)
	#define cbgl_free(p) free(p)

#endif

#endif /* __LIBCBGL32MEMORY_H__ */